clear


forvalues n = 1995/2017 {
use "microdata\rpiexpendituredata\kidsrpicons`n'.dta", clear
keep caseno datayear totexp FOOD CATERING ALCOHOL TOBACCO HOUSING FUEL_LIG HHGOODS HHSERVS CLOTH_SH P_GD_SER MOTORING FARESET LGOODS LSERVS nondur semidur durables mortgagetot mortgageint insgr bread	cereals	biscuits beef	lamb	pork	bacon	poul_oth poultry	oth_meat	fish butter		cheese	eggs	milkfres	milkprod oil_fats fruit potatoes	oth_vegs swe_choc sug_pres oth_food tea	coffee	softdrin offwinsp	offbeer onbeer onwinsp  domservs petcare postage	telephon	telemess  fees_sub 
*merge m:1 hhref using "demosave/demo`n'.dta",keep(match) nogen
rename * kid*
rename kidcaseno caseno
rename kiddatayear datayear

save processed/rpisave/kidrpi`n'.dta,replace
}

